;(function (window,$) {
    // 创建右键菜单对象
    function ContextMenu(callback) {
        return new ContextMenu.prototype.init(this,callback);
    }
    ContextMenu.prototype = {
        constructor:ContextMenu,
        init:function (contextmenuList,callback) {
             this.show(contextmenuList,callback);
        },
        show:function (contextmenuList,callback) {
             $(document).on("contextmenu",function (e) {
                 var evt = e || window.event;
                 evt.preventDefault();
                 contextmenuList.css({
                     left:e.pageX + "px",
                     top:e.pageY + "px",
                     display:"block",
                 });
                 contextmenuList.click(function (e) {
                     contextmenuList.css("display","none");
                     if (callback) {
                         callback.bind(this)(e.target);
                     }
                 })
             });
        }
    };
    ContextMenu.prototype.init.prototype = ContextMenu.prototype;
    // 给Utils进行扩展
    $.fn.extends({contextmenu:ContextMenu})
})(window,Util);